<#include "/@inc/uiMacros.ftl">
<#include "/@inc/funcMacros.ftl">
<#include "/@inc/copyright.txt">
<#assign className = TriaGram + Prefix + LateType + "Cmd">
<#assign intfName = TriaGram + "I" + Prefix + LateType>
<#assign baseName = TriaGram + Prefix + LateType>
<@pp.renameOutputFile name=className+".h">
</@pp.renameOutputFile>
//==============================================================================
//
// ${className}.h
// The command: ${className}
//
//===============================================================================
//  ${Month} ${Year}  Creation: Code generated by the CAA wizard  ${Author}
//===============================================================================
#ifndef ${className}_H
#define ${className}_H

<@CALC_STATES Attributes  />

<#assign numStates = states?size >

#include "${TriaGram}UtlPanelStateCmd.h"
#include "${TriaGram}IUtlEntityList.h"

class ${baseName}Dlg ;
class ${intfName}_var;
<#switch numStates >
<#case 0>
<#break>
<#default>
class CATFeatureAgent ;
class CATDialogAgent;
<#break>
</#switch>

/**
 * Command for ${LateType} Feature.
 */

class ${className}: public ${TriaGram}UtlPanelStateCmd
{
  DeclareResource( ${className}, ${TriaGram}UtlPanelStateCmd )

  public:

    /**
    * Standard constructors. Default mode of the command is creation.
    * @See CATMMUIPanelStateCmd
    * @param inMode
    * 0 - Edition mode
    * 1 - Creation mode
    */
    ${className}(CATISpecObject *ipSpec = NULL, int 	inCommandMode =1);

    virtual ~${className}();

	 /**
	* Defines the command automata.
	* <br>
	* <i>(states, transitions and agents)</i>
	*/
	virtual void BuildGraph();

	/**
	* This method returns the Panel
	* CATMMUIPanelStateCmd method
	*/
	CATDlgDialog* GiveMyPanel();

   /**
    * Deals with Ok button click event.
    */
   virtual CATBoolean OkAction(void *iData);

   /**
    * Deals with Preview button click event.
    */
   virtual CATBoolean PreviewAction(void *iData);

<#list Attributes as attrib>
<#switch attrib.UI>
<#case "PolyList">
   /**
    * Callback function for ${attrib.name} MultiList column names. see @${TriaGram}UtlDlgListColumnName.
    */
   int ${attrib.name}ColumnName (${TriaGram}IUtlEntity *ipEnt, int inCol, CATUnicodeString & oStrName) ;
<#break>
</#switch>
</#list>

void CreateStateChart () ;

<#list states as st>
CATBoolean OnSelect${st.name}(void *) ;

CATBoolean OnSelect${st.name}List(void *) ;
</#list>

  private:

	//Helper Function
    void BuildPanel() ;

   /**
    * Creates Feature instance from Catalog.
    */
	HRESULT CreateFeature();

   /**
    * Retrieves data from dialog and sets it on Feature.
    */
    HRESULT SetFeatureData() ;


   /**
    * Sest data to Feature using Automation Interface. Use ful is script recording is on.
    */
	HRESULT SetFeatureDataViaAutomation() ;

	HRESULT CheckModel();

	${baseName}Dlg*			_pPanel;

<#list Attributes as attrib>
<#switch attrib.UI>
<#case "List">
<#case "BiList">
<#case "PolyList">
	${TriaGram}UtlDlgFrame 					* _pUtlDlgFrame${attrib.name}    ;

    ${TriaGram}UtlPanelStateCmd::${TriaGram}UtlPanelFrameStyle    _FrameStyle${attrib.name}  ;
<#break>
</#switch>
</#list>

 // Agent to select a feature/list
<#list states as st>
CATFeatureAgent			* _pFeatureAgent${st.name}  ;
CATDialogAgent			* _pDialogAgent${st.name}  ;
</#list>

    // Copy constructor, not implemented
    // Set as private to prevent from compiler automatic creation as public.
    ${className}(const ${className} &iObjectToCopy);

    // Assignment operator, not implemented
    // Set as private to prevent from compiler automatic creation as public.
    ${className} & operator = (const ${className} &iObjectToCopy);

};

//----------------------------------------------------------------------

#endif

